package com.kuaiyin.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.kuaiyin.enums.Status;
import com.kuaiyin.sampling.BaseVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Map;

@EqualsAndHashCode(callSuper = true)
@Data
@Schema(name = "TestCaseDetailVO", description = "测试用例详情响应")
public class TestCaseVO extends BaseVo implements Serializable {

    @Schema(description = "用例ID", example = "1")
    private Long id;

    @Schema(description = "用例名称", example = "用户登录测试")
    private String name;

    @Schema(description = "关联请求ID", example = "123")
    private Long requestId;

    @Schema(description = "关联的环境类型")
    private String environmentType; // DEV, TEST, STAGING, PROD


    @Schema(description = "执行状态", example = "SUCCESS")
    private String execStatus;

    @Schema(description = "最后执行时间", example = "2023-10-01 10:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastRunTime;

    @Schema(description = "状态：0-禁用 1-启用")
    private Status status;

    @Schema(description = "断言规则（JSON数组）")
    private Map<String, Object> assertions;

    @Schema(description = "最后一次执行耗时（毫秒）")
    private Integer lastRunDuration;

    @Schema(description = "断言结果（SUCCESS/FAILED）", example = "SUCCESS")
    private String lastRunResult;

}
